/*   1:    */ package com.rinsi.app.jczl.kjxx;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.AssertUtil;
/*   6:    */ import com.rinsi.util.MapUtil;
/*   7:    */ import java.util.HashMap;
/*   8:    */ import java.util.List;
/*   9:    */ import java.util.Map;
/*  10:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  11:    */ import org.springframework.stereotype.Service;
/*  12:    */ 
/*  13:    */ @Service
/*  14:    */ public class KjxxService
/*  15:    */   extends CoreSimpleService
/*  16:    */ {
/*  17:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  18:    */   {
/*  19: 25 */     Map<String, Object> params = getParams(model);
/*  20:    */     
/*  21: 27 */     Map<String, Object> config = getConfig(model);
/*  22:    */     
/*  23: 29 */     int goQyzl = ((Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".goQyzl", params)).intValue();
/*  24:    */     
/*  25: 31 */     boolean isGo = goQyzl == 1;
/*  26:    */     
/*  27: 33 */     rMap.put("goQyzl", Boolean.valueOf(isGo));
/*  28:    */     
/*  29: 35 */     rMap.put("sssss", getSqlSessionTemplate().selectList("Core.getCodeList", "400001"));
/*  30:    */     
/*  31: 37 */     rMap.put("jjlxs", getSqlSessionTemplate().selectList("Core.getCodeList", "400002"));
/*  32:    */     
/*  33: 39 */     rMap.put("mklbs", getSqlSessionTemplate().selectList("Core.getCodeList", "400003"));
/*  34:    */     
/*  35: 41 */     rMap.put("mkzts", getSqlSessionTemplate().selectList("Core.getCodeList", "400004"));
/*  36:    */     
/*  37: 43 */     rMap.put("ktfss", getSqlSessionTemplate().selectList("Core.getCodeList", "400005"));
/*  38:    */     
/*  39: 45 */     rMap.put("kjjxs", getSqlSessionTemplate().selectList("Core.getCodeList", "400006"));
/*  40:    */     
/*  41: 47 */     Map<String, Object> organ = CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "organ");
/*  42:    */     
/*  43: 49 */     rMap.put("ORGAN_TYPE", MapUtil.getString(organ, "ORGAN_TYPE"));
/*  44:    */   }
/*  45:    */   
/*  46:    */   public void beforeList(Map<String, Object> model)
/*  47:    */   {
/*  48: 56 */     Map<String, Object> params = getParams(model);
/*  49:    */     
/*  50: 58 */     Map<String, Object> config = getConfig(model);
/*  51:    */     
/*  52: 60 */     Map<String, Object> organ = CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "organ");
/*  53:    */     
/*  54: 62 */     Map<String, Object> paramsOrgan = new HashMap();
/*  55:    */     
/*  56: 64 */     paramsOrgan.putAll(params);
/*  57:    */     
/*  58: 66 */     paramsOrgan.remove("ORGAN_ID");
/*  59:    */     
/*  60: 68 */     paramsOrgan.remove("KJJBXX_KJMC");
/*  61:    */     
/*  62: 70 */     paramsOrgan.remove("KJJBXX_JJLX");
/*  63:    */     
/*  64: 72 */     paramsOrgan.remove("KJJBXX_MKLB");
/*  65:    */     
/*  66: 74 */     paramsOrgan.remove("KJJBXX_MKZT");
/*  67:    */     
/*  68: 76 */     paramsOrgan.putAll(organ);
/*  69: 78 */     if (MapUtil.getInteger(organ, "ORGAN_TYPE").intValue() == 9)
/*  70:    */     {
/*  71: 80 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", paramsOrgan);
/*  72: 82 */       if (!AssertUtil.isCollectionNotEmpty(datas))
/*  73:    */       {
/*  74: 84 */         List<Map<String, Object>> qyxxs = getSqlSessionTemplate().selectList(namespace(config) + ".countQy", paramsOrgan);
/*  75: 86 */         if (qyxxs.size() > 0)
/*  76:    */         {
/*  77: 88 */           paramsOrgan.put("KJJBXX_SSQYMC", ((Map)qyxxs.get(0)).get("QYJBXX_MC"));
/*  78:    */           
/*  79: 90 */           paramsOrgan.put("KJJBXX_KJSZS", ((Map)qyxxs.get(0)).get("QYJBXX_SZS"));
/*  80:    */           
/*  81: 92 */           paramsOrgan.put("KJJBXX_XXDZ", ((Map)qyxxs.get(0)).get("QYJBXX_XXDZ"));
/*  82:    */         }
/*  83: 96 */         List<Map<String, Object>> ckxkzs = getSqlSessionTemplate().selectList(namespace(config) + ".countCkxkz", paramsOrgan);
/*  84: 98 */         if (ckxkzs.size() > 0)
/*  85:    */         {
/*  86:100 */           paramsOrgan.put("KJJBXX_JJLX", ((Map)ckxkzs.get(0)).get("CKZ_JJLX"));
/*  87:    */           
/*  88:102 */           paramsOrgan.put("KJJBXX_PZKCMC", ((Map)ckxkzs.get(0)).get("CKZ_PZMC"));
/*  89:    */         }
/*  90:106 */         String key = getKey(config);
/*  91:    */         
/*  92:108 */         paramsOrgan.put(MapUtil.getString(config, "module.idCol"), key);
/*  93:    */         
/*  94:110 */         getSqlSessionTemplate().insert(namespace(config) + ".insert", paramsOrgan);
/*  95:    */       }
/*  96:    */     }
/*  97:    */   }
/*  98:    */   
/*  99:    */   public Map<String, Object> changeSJZT(Map<String, Object> model)
/* 100:    */   {
/* 101:118 */     Map<String, Object> params = getParams(model);
/* 102:    */     
/* 103:120 */     Map<String, Object> config = getConfig(model);
/* 104:    */     
/* 105:122 */     Map<String, Object> rMap = getRMap();
/* 106:    */     try
/* 107:    */     {
/* 108:126 */       getSqlSessionTemplate().selectOne(namespace(config) + ".changeSJZT", params);
/* 109:    */       
/* 110:128 */       rMap.put("success", Boolean.valueOf(true));
/* 111:    */     }
/* 112:    */     catch (Exception ex)
/* 113:    */     {
/* 114:132 */       rMap.put("success", Boolean.valueOf(false));
/* 115:    */     }
/* 116:136 */     return rMap;
/* 117:    */   }
/* 118:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.jczl.kjxx.KjxxService
 * JD-Core Version:    0.7.0.1
 */